<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    body {
      /* 属性添加给父级 */
      /* 数值一般在800px-1200px */
      /* 作用是增加透视效果 */
      perspective: 800px;
    }

    .box {
      width: 200px;
      height: 200px;
      margin: 100px auto;
      background-color: pink;
      transition: all .5s;
    }

    .box:hover {
      /* transform: translate3d(20px,30px,10px); */
      /* transform: translateX(100px); */
      /* transform: translateY(100px); */
      /* transform: translateZ(200px); */
      /* 必须加perspective属性才能看到效果 */
      transform: translateZ(300px);
    }
  </style>
</head>

<body>
  <div class="box"></div>
</body>

</html>